home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Libris Britannia 4
/
science library(b).zip
/
science library(b)
/
PROGRAMM
/
TUTORIAL
/
1307B.ZIP
/
FUNCTION.MOD
< prev
next >
Wrap
Text File
|
1989-01-18
|
580b
|
32 lines
(* Chapter 5 - Program 6 *)
MODULE Function;
FROM InOut IMPORT WriteString, WriteInt, WriteLn;
PROCEDURE QuadOfSum(Number1, Number2 : INTEGER) : INTEGER;
BEGIN
RETURN(4*(Number1 + Number2));
END QuadOfSum;
VAR Dogs, Cats, Feet : INTEGER;
BEGIN (* Main program *)
Dogs := 4;
Cats := 3;
Feet := QuadOfSum(Dogs,Cats);
WriteString("There are a total of");
WriteInt(Feet,3);
WriteString(" paws.");
WriteLn;
END Function.
(* Result of execution
There are a total of 28 paws.
*)